3.756 \(\int \csc ^2(c+d x) \sec ^2(c+d x) (a+a \sin (c+d x)) \, dx\)

Optimal. Leaf size=48 \[ \frac{a \tan (c+d x)}{d}-\frac{a \cot (c+d x)}{d}+\frac{a \sec (c+d x)}{d}-\frac{a \tanh ^{-1}(\cos (c+d x))}{d} \]

[Out]

-((a*ArcTanh[Cos[c + d*x]])/d) - (a*Cot[c + d*x])/d + (a*Sec[c + d*x])/d + (a*Tan[c + d*x])/d

________________________________________________________________________________________

Rubi [A]  time = 0.108878, antiderivative size = 48, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.222, Rules used = {2838, 2620, 14, 2622, 321, 207} \[ \frac{a \tan (c+d x)}{d}-\frac{a \cot (c+d x)}{d}+\frac{a \sec (c+d x)}{d}-\frac{a \tanh ^{-1}(\cos (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Int[Csc[c + d*x]^2*Sec[c + d*x]^2*(a + a*Sin[c + d*x]),x]

[Out]

-((a*ArcTanh[Cos[c + d*x]])/d) - (a*Cot[c + d*x])/d + (a*Sec[c + d*x])/d + (a*Tan[c + d*x])/d

Rule 2838

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((a_) + (b_.)*sin[(e_.) + (f_.)
*(x_)]), x_Symbol] :> Dist[a, Int[(g*Cos[e + f*x])^p*(d*Sin[e + f*x])^n, x], x] + Dist[b/d, Int[(g*Cos[e + f*x
])^p*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x]

Rule 2620

Int[csc[(e_.) + (f_.)*(x_)]^(m_.)*sec[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> Dist[1/f, Subst[Int[(1 + x^2)^((
m + n)/2 - 1)/x^m, x], x, Tan[e + f*x]], x] /; FreeQ[{e, f}, x] && IntegersQ[m, n, (m + n)/2]

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2622

Int[csc[(e_.) + (f_.)*(x_)]^(n_.)*((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Dist[1/(f*a^n), Subst[Int
[x^(m + n - 1)/(-1 + x^2/a^2)^((n + 1)/2), x], x, a*Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n
 + 1)/2] &&  !(IntegerQ[(m + 1)/2] && LtQ[0, m, n])

Rule 321

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c^(n - 1)*(c*x)^(m - n + 1)*(a + b*x^n
)^(p + 1))/(b*(m + n*p + 1)), x] - Dist[(a*c^n*(m - n + 1))/(b*(m + n*p + 1)), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 207

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTanh[(Rt[b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \csc ^2(c+d x) \sec ^2(c+d x) (a+a \sin (c+d x)) \, dx &=a \int \csc (c+d x) \sec ^2(c+d x) \, dx+a \int \csc ^2(c+d x) \sec ^2(c+d x) \, dx\\ &=\frac{a \operatorname{Subst}\left (\int \frac{x^2}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{d}+\frac{a \operatorname{Subst}\left (\int \frac{1+x^2}{x^2} \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac{a \sec (c+d x)}{d}+\frac{a \operatorname{Subst}\left (\int \left (1+\frac{1}{x^2}\right ) \, dx,x,\tan (c+d x)\right )}{d}+\frac{a \operatorname{Subst}\left (\int \frac{1}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{d}\\ &=-\frac{a \tanh ^{-1}(\cos (c+d x))}{d}-\frac{a \cot (c+d x)}{d}+\frac{a \sec (c+d x)}{d}+\frac{a \tan (c+d x)}{d}\\ \end{align*}

Mathematica [A]  time = 0.0752202, size = 68, normalized size = 1.42 \[ \frac{a \tan (c+d x)}{d}-\frac{a \cot (c+d x)}{d}+\frac{a \sec (c+d x)}{d}+\frac{a \log \left (\sin \left (\frac{1}{2} (c+d x)\right )\right )}{d}-\frac{a \log \left (\cos \left (\frac{1}{2} (c+d x)\right )\right )}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[c + d*x]^2*Sec[c + d*x]^2*(a + a*Sin[c + d*x]),x]

[Out]

-((a*Cot[c + d*x])/d) - (a*Log[Cos[(c + d*x)/2]])/d + (a*Log[Sin[(c + d*x)/2]])/d + (a*Sec[c + d*x])/d + (a*Ta
n[c + d*x])/d

________________________________________________________________________________________

Maple [A]  time = 0.073, size = 69, normalized size = 1.4 \begin{align*}{\frac{a}{d\cos \left ( dx+c \right ) }}+{\frac{a\ln \left ( \csc \left ( dx+c \right ) -\cot \left ( dx+c \right ) \right ) }{d}}+{\frac{a}{d\sin \left ( dx+c \right ) \cos \left ( dx+c \right ) }}-2\,{\frac{a\cot \left ( dx+c \right ) }{d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(d*x+c)^2*sec(d*x+c)^2*(a+a*sin(d*x+c)),x)

[Out]

1/d*a/cos(d*x+c)+1/d*a*ln(csc(d*x+c)-cot(d*x+c))+1/d*a/sin(d*x+c)/cos(d*x+c)-2*a*cot(d*x+c)/d

________________________________________________________________________________________

Maxima [A]  time = 1.09502, size = 80, normalized size = 1.67 \begin{align*} \frac{a{\left (\frac{2}{\cos \left (d x + c\right )} - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )} - 2 \, a{\left (\frac{1}{\tan \left (d x + c\right )} - \tan \left (d x + c\right )\right )}}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)^2*sec(d*x+c)^2*(a+a*sin(d*x+c)),x, algorithm="maxima")

[Out]

1/2*(a*(2/cos(d*x + c) - log(cos(d*x + c) + 1) + log(cos(d*x + c) - 1)) - 2*a*(1/tan(d*x + c) - tan(d*x + c)))
/d

________________________________________________________________________________________

Fricas [B]  time = 1.11007, size = 446, normalized size = 9.29 \begin{align*} -\frac{4 \, a \cos \left (d x + c\right )^{2} + 2 \, a \cos \left (d x + c\right ) +{\left (a \cos \left (d x + c\right )^{2} +{\left (a \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) - a\right )} \log \left (\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) -{\left (a \cos \left (d x + c\right )^{2} +{\left (a \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) - a\right )} \log \left (-\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) - 2 \,{\left (2 \, a \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) - 2 \, a}{2 \,{\left (d \cos \left (d x + c\right )^{2} +{\left (d \cos \left (d x + c\right ) + d\right )} \sin \left (d x + c\right ) - d\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)^2*sec(d*x+c)^2*(a+a*sin(d*x+c)),x, algorithm="fricas")

[Out]

-1/2*(4*a*cos(d*x + c)^2 + 2*a*cos(d*x + c) + (a*cos(d*x + c)^2 + (a*cos(d*x + c) + a)*sin(d*x + c) - a)*log(1
/2*cos(d*x + c) + 1/2) - (a*cos(d*x + c)^2 + (a*cos(d*x + c) + a)*sin(d*x + c) - a)*log(-1/2*cos(d*x + c) + 1/
2) - 2*(2*a*cos(d*x + c) + a)*sin(d*x + c) - 2*a)/(d*cos(d*x + c)^2 + (d*cos(d*x + c) + d)*sin(d*x + c) - d)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)**2*sec(d*x+c)**2*(a+a*sin(d*x+c)),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.2505, size = 117, normalized size = 2.44 \begin{align*} \frac{2 \, a \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) \right |}\right ) + a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - \frac{a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 4 \, a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - a}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )}}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)^2*sec(d*x+c)^2*(a+a*sin(d*x+c)),x, algorithm="giac")

[Out]

1/2*(2*a*log(abs(tan(1/2*d*x + 1/2*c))) + a*tan(1/2*d*x + 1/2*c) - (a*tan(1/2*d*x + 1/2*c)^2 + 4*a*tan(1/2*d*x
 + 1/2*c) - a)/(tan(1/2*d*x + 1/2*c)^2 - tan(1/2*d*x + 1/2*c)))/d